<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GThemedIcon</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO 参考手册">
<link rel="up" href="icons.html" title="Icons">
<link rel="prev" href="gio-GLoadableIcon.html" title="GLoadableIcon">
<link rel="next" href="gio-GEmblemedIcon.html" title="GEmblemedIcon">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gio-GLoadableIcon.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="icons.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO 参考手册</th>
<td><a accesskey="n" href="gio-GEmblemedIcon.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gio-GThemedIcon.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gio-GThemedIcon.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gio-GThemedIcon"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gio-GThemedIcon.top_of_page"></a>GThemedIcon</span></h2>
<p>GThemedIcon — Icon theming support</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gio-GThemedIcon.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon">GThemedIcon</a>;
<a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             <a class="link" href="gio-GThemedIcon.html#g-themed-icon-new" title="g_themed_icon_new ()">g_themed_icon_new</a>                   (<em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);
<a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             <a class="link" href="gio-GThemedIcon.html#g-themed-icon-new-from-names" title="g_themed_icon_new_from_names ()">g_themed_icon_new_from_names</a>        (<em class="parameter"><code><span class="type">char</span> **iconnames</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> len</code></em>);
<a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             <a class="link" href="gio-GThemedIcon.html#g-themed-icon-new-with-default-fallbacks" title="g_themed_icon_new_with_default_fallbacks ()">g_themed_icon_new_with_default_fallbacks</a>
                                                        (<em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GThemedIcon.html#g-themed-icon-prepend-name" title="g_themed_icon_prepend_name ()">g_themed_icon_prepend_name</a>          (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GThemedIcon.html#g-themed-icon-append-name" title="g_themed_icon_append_name ()">g_themed_icon_append_name</a>           (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="gio-GThemedIcon.html#g-themed-icon-get-names" title="g_themed_icon_get_names ()">g_themed_icon_get_names</a>           (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gio-GThemedIcon.description"></a><h2>Description</h2>
<p>
<a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> is an implementation of <a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="type">GIcon</span></a> that supports icon themes.
<a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> contains a list of all of the icons present in an icon
theme, so that icons can be looked up quickly. <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> does
not provide actual pixmaps for icons, just the icon names.
Ideally something like <code class="function">gtk_icon_theme_choose_icon()</code> should be used to
resolve the list of names so that fallback icons work nicely with
themes that inherit other themes.
</p>
</div>
<div class="refsect1">
<a name="gio-GThemedIcon.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GThemedIcon"></a><h3>GThemedIcon</h3>
<pre class="programlisting">typedef struct _GThemedIcon GThemedIcon;</pre>
<p>
An implementation of <a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="type">GIcon</span></a> for themed icons.
</p>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-new"></a><h3>g_themed_icon_new ()</h3>
<pre class="programlisting"><a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             g_themed_icon_new                   (<em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);</pre>
<p>
Creates a new themed icon for <em class="parameter"><code>iconname</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iconname</code></em> :</span></p></td>
<td>a string containing an icon name.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-new-from-names"></a><h3>g_themed_icon_new_from_names ()</h3>
<pre class="programlisting"><a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             g_themed_icon_new_from_names        (<em class="parameter"><code><span class="type">char</span> **iconnames</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> len</code></em>);</pre>
<p>
Creates a new themed icon for <em class="parameter"><code>iconnames</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iconnames</code></em> :</span></p></td>
<td>an array of strings containing icon names. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=len]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td>the length of the <em class="parameter"><code>iconnames</code></em> array, or -1 if <em class="parameter"><code>iconnames</code></em> is
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-new-with-default-fallbacks"></a><h3>g_themed_icon_new_with_default_fallbacks ()</h3>
<pre class="programlisting"><a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="returnvalue">GIcon</span></a> *             g_themed_icon_new_with_default_fallbacks
                                                        (<em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);</pre>
<p>
Creates a new themed icon for <em class="parameter"><code>iconname</code></em>, and all the names
that can be created by shortening <em class="parameter"><code>iconname</code></em> at '-' characters.
</p>
<p>
In the following example, <em class="parameter"><code>icon1</code></em> and <em class="parameter"><code>icon2</code></em> are equivalent:
</p>
<div class="informalexample"><pre class="programlisting">
const char *names[] = { 
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome"
};

icon1 = g_themed_icon_new_from_names (names, 4);
icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
</pre></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iconname</code></em> :</span></p></td>
<td>a string containing an icon name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-prepend-name"></a><h3>g_themed_icon_prepend_name ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_themed_icon_prepend_name          (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);</pre>
<p>
Prepend a name to the list of icons from within <em class="parameter"><code>icon</code></em>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Note that doing so invalidates the hash computed by prior calls
to <a class="link" href="gio-GIcon.html#g-icon-hash" title="g_icon_hash ()"><code class="function">g_icon_hash()</code></a>.
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iconname</code></em> :</span></p></td>
<td>name of icon to prepend to list of icons from within <em class="parameter"><code>icon</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-append-name"></a><h3>g_themed_icon_append_name ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_themed_icon_append_name           (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *iconname</code></em>);</pre>
<p>
Append a name to the list of icons from within <em class="parameter"><code>icon</code></em>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Note that doing so invalidates the hash computed by prior calls
to <a class="link" href="gio-GIcon.html#g-icon-hash" title="g_icon_hash ()"><code class="function">g_icon_hash()</code></a>.
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iconname</code></em> :</span></p></td>
<td>name of icon to append to list of icons from within <em class="parameter"><code>icon</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-themed-icon-get-names"></a><h3>g_themed_icon_get_names ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_themed_icon_get_names           (<em class="parameter"><code><a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a> *icon</code></em>);</pre>
<p>
Gets the names of icons from within <em class="parameter"><code>icon</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GThemedIcon.html#GThemedIcon" title="GThemedIcon"><span class="type">GThemedIcon</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a list of icon names. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gio-GThemedIcon.see-also"></a><h2>See Also</h2>
<a class="link" href="gio-GIcon.html#GIcon" title="GIcon"><span class="type">GIcon</span></a>, <a class="link" href="gio-GLoadableIcon.html#GLoadableIcon" title="GLoadableIcon"><span class="type">GLoadableIcon</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>